/*
 * @(#)cn.design.pattern.flyweight 2020/4/21/0021
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.flyweight;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/21/0021
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class Client {
	public static void main(String[] args) {
		WebSiteFactory factory = new WebSiteFactory();
		WebSite webSite1 = factory.getWebSiteCategory("新闻");
		User user = new User();
		user.setName("Tom");
		webSite1.use(user);
		WebSite webSite2 = factory.getWebSiteCategory("新闻");
		user = new User();
		user.setName("Toby");
		webSite2.use(user);
		System.out.println("池中的总数为：" + factory.getWebSiteCount());
	}
}
